import http from '../common/axios.js'

// 获取目录
function getCategoryList(data) {
	let url = '/v2/plaza_post/getCategoryList'
	return http.post(url, data)
}
// 获取分类下的文章
function forumindex(data) {
	let url = 'v2/plaza_post/index'
	return http.post(url, data)
}
// 获取分类下的文章-未登录
function forumPlateIndex(data) {
	let url = 'v2/plaza_post/getPlateIndex'
	return http.post(url, data)
}
// 点赞
function addLive(data) {
	let url = '/v2/comment/addLive'
	return http.post(url, data)
}
// 删除点赞
function delLive(data) {
	let url = '/v2/comment/delLive'
	return http.post(url, data)
}
// 收藏
function addFavorite(data) {
	let url = '/v2/comment/addFavorite'
	return http.post(url, data)
}
// 删除收藏
function delFavorite(data) {
	let url = '/v2/comment/delFavorite'
	return http.post(url, data)
}
// 专辑列表
function videoShow(data) {
	let url = '/v2/plaza_post/show'
	return http.get(url, data)
}
// 专辑详情
function getAlbumVideoList(data) {
	let url = '/v2/video/getAlbumVideoList'
	return http.get(url, data)
}
// 专辑评论
function AlbumComment(data) {
	let url = '/v2/comment/inedx'
	return http.get(url, data)
}
// 评星
function addRating(data) {
	let url = '/v2/comment/addRating'
	return http.post(url, data)
}
// 发帖
function articleAdd(data) {
	let url = '/v2/plaza_post/add'
	return http.post(url, data)
}
// 配置项
function getWebConfig() {
	let url = '/v2/config/getWebConfig'
	return http.get(url)
}
// 添加评论
function addComment(data) {
	let url = 'v2/comment/addComment'
	// #ifdef MP-WEIXIN
	data['form_type'] = 'mini'
	// #endif
	return http.post(url,data)
}
// 轮播图
function get_management(data) {
	let url = '/user/get_management'
	return http.get(url,data)
}
// 预告
function getLiveForeshow() {
	let url = '/v2/plaza_post/getLiveForeshow'
	return http.get(url)
}
// 详情
function getLiveshow(data) {
	let url = '/v2/plaza_post/show'
	return http.get(url,data)
}
// 删除帖子
function delPost(data) {
	let url = '/v2/plaza_post/delPost'
	return http.post(url,data)
}
// 修改帖子
function updatePost (data) {
	let url = '/v2/plaza_post/updatePost'
    return http.post(url,data)
}
// 删除评论
function delComment (data) {
	let url = '/v2/comment/delComment'
    return http.post(url,data)
}
// 修改评论
function updateComment (data) {
	let url = '/v2/comment/updateComment'
    return http.post(url,data)
}
// 获取会员列表
function getVipList () {
	let url = '/v2/user/getUserGroupList'
    return http.get(url)
}
// 审核申请
function createVip(data) {
	let url = '/order/create'
    return http.get(url,data)
}
// 查看订单
function scorePay(data) {
	let url = '/v2/score_pay/pay'
    return http.post(url,data)
}
// 获取支付二维码
function Vipquery(data) {
	let url = '/order/show'
    return http.post(url,data)
}
// 支付
function payVip(data) {
	let url = '/wechat_pay/wechatNativePay'
    return http.post(url,data)
}
// 获取栏目会员列表
function goodsShow(data) {
	let url = '/order/goodsShow'
    return http.post(url,data)
}
// 搜索
function searchList(data) {
	let url = '/v2/search/searchList'
    return http.get(url,data)
}
// 帖子详情
function postShow(data) {
	let url = '/v2/plaza_post/show'
    return http.get(url,data)
}
// 获取分类简介列表
function postGetList(data) {
	let url = '/v2/introduce/getList'
    return http.post(url,data)
}
// 不需要登录获取帖子内容
function shareShow(data) {
	let url = '/v2/share/show'
    return http.post(url,data)
}
// 获取分享内容的图片
function getRandomShareCoverImage(data) {
	let url = '/v2/share/getRandomShareCoverImage'
    return http.get(url,data)
}

export default {
	getCategoryList,
	forumindex,
	forumPlateIndex,
	addLive,
	delLive,
	addFavorite,
	delFavorite,
	videoShow,
	getAlbumVideoList,
	AlbumComment,
	addRating,
	articleAdd,
	getWebConfig,
	addComment,
	get_management,
	getLiveForeshow,
	getLiveshow,
	delPost,
	updatePost,
	delComment,
	updateComment,
	getVipList,
	createVip,
	scorePay,
	Vipquery,
	payVip,
	goodsShow,
	searchList,
	postShow,
	postGetList,
	shareShow,
	getRandomShareCoverImage
}